# $Id: PKGBUILD 184005 2013-04-30 18:42:55Z giovanni $
# Maintainer: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: dorphell <dorphell@archlinux.org>

pkgname=tcpdump
pkgver=4.4.0
pkgrel=1
pkgdesc="A tool for network monitoring and data acquisition"
arch=('i686' 'x86_64')
url="http://www.tcpdump.org"
license=('BSD')
depends=('libpcap' 'openssl')
source=("http://www.tcpdump.org/release/${pkgname}-${pkgver}.tar.gz"
        'tcpdump_duplicate_executable.patch')
md5sums=('6f75aabcffd012f73bd7c331bb5d8232'
         '96c116e5ed51759a029bb6c236d63178')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  # do not install tcpdump-4.1.1 executable (FS#23346)
  patch -Np1 -i "${srcdir}/tcpdump_duplicate_executable.patch"

  ./configure --prefix=/usr \
              --enable-ipv6
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  make DESTDIR="${pkgdir}" install

  #install the license
  install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
